<template>
	<view class="item" @click="tanToDetail(item.id)">
		<image class="item" :src="item.img_url" controls></image>
		<view class="title">
		    <h4>{{item.title}}</h4>
			<span style="display: flex;justify-content: space-between;">
				<span>{{item.source}}</span>
				<span class="tp">
					<image v-if="item.likestatus === 1" src=".././img/点赞1.png" class="like-image"></image>
					<image v-else src=".././img/点赞2.png" class="like-image"></image>
					&nbsp;<span>{{item.like_count}}&nbsp;&nbsp;&nbsp;</span>
					<span><img style="width: 20px;height: 20px;padding-right: 25px;" src=".././img/分享.png" alt="" /></span>
				</span>
			</span>
		</view>
	</view>
</template>

<script>
	export default {
		name:"video",
		data() {
			return {
				// item: [],
				// index:'',
			};
		},
		props: {
			item: {
				type: Object,
				required: true
			},
			index: {
				type: Number,
				required: true
			},
			active: {
				type: Number,
				required: true
			}
		},
		methods: {
			tanToDetail(id) {
				uni.navigateTo({
					url: './videodetail?id=' + id + '&type=' + this.active
				})
			}
		}
	}
</script>

<style lang="scss">
.item {
	width: 100%;
}
.title {
	text-align: left;
	margin: 8px;
	span {
		font-size: 10px;
	}
	.tp {
		text-align:left
	}
}

.like-image {
	width: 20px; /* 设置图片宽度 */
	height: 20px; /* 设置图片高度 */
}
</style>